home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 16292 < prev    next >
Encoding:
Text File  |  1996-08-05  |  907 b   |  45 lines

  1. Path: newshost.uwo.ca!usenet
  2. From: Sharon Wang <swang1@julian.uwo.ca>
  3. Newsgroups: comp.lang.c++
  4. Subject: HELP: A basic question
  5. Date: 10 Apr 1996 06:42:20 GMT
  6. Organization: UWO, London, Canada
  7. Message-ID: <4kfl8c$nju@falcon.ccs.uwo.ca>
  8. NNTP-Posting-Host: ts3-30.slip.uwo.ca
  9. Mime-Version: 1.0
  10. Content-Type: text/plain; charset=us-ascii
  11. Content-Transfer-Encoding: 7bit
  12. X-Authenticated: swang1@ts3-30.slip.uwo.ca
  13. X-Mailer: Mozilla 1.22 (Windows; I; 16bit)
  14.  
  15. hello worlf, i have the following code which compiles ok but causes
  16. segmentation fault:
  17.  
  18. class T{
  19.     ...
  20. public:
  21.     ...
  22.     T deform();
  23. };
  24.  
  25. T T::deform(void)
  26. {
  27.     T c;
  28.     ...
  29.     return c;  // guess something wrong here
  30. }
  31.  
  32. int main(void)
  33. {
  34.     T a, b;
  35.     ...
  36.     b = a.deform();  // ERROR: segmentation fault! ('=' overloaded ok)
  37. }
  38.  
  39. can anyone tell me what's wrong with the code, or please tell me
  40. if this is not the right place to post.
  41.  
  42. sharon
  43.  
  44.  
  45.